package com.finley.flowabledemo.design.state;


import cn.hutool.core.util.StrUtil;

/**
 * @description:
 * @author: xianfei.chao
 * @date 2025/5/31 10:47
 * @version: 1.0
 */
public class EveningWorkState extends IWorkState{
    /**
     * 写程序
     *
     * @param workContext 工作上下文
     */
    @Override
    void writeProgram(WorkContext workContext) {
        if (workContext.getFinish()) {
            workContext.setWorkState(new FinishWorkState());
            workContext.handle();
        }else{
            if (workContext.getHours() < 21) {
                System.out.println(StrUtil.format(FORMAT_PRE + "加班中...疲惫至极", workContext.getHours()));
            }else{
                workContext.setWorkState(new SleepWorkState());
                workContext.handle();
            }
        }
    }

    @Override
    String getDescription() {
        return "";
    }
}
